package web;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class QuitLoginServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Cookie[] cookies=req.getCookies();
        for (Cookie c:cookies) {
            c.setMaxAge(0);
            c.setPath("/College_war_exploded");
            resp.addCookie(c);
        }
        resp.sendRedirect("login.jsp");
    }
}
